//
//  WmcSelectView.swift
//  YPWatermarkCamera
//
//  Created by 赵新 on 2022/3/11.
//

import UIKit

class WmcSelectView: WmcBaseView {
    lazy var titleView: WmcSelectTitleView = {
        let titleView = WmcSelectTitleView()
        return titleView
    }()

    lazy var maskLayer: CAShapeLayer = {
        let maskLayer = CAShapeLayer()
        return maskLayer
    }()

    /// 标题
    var title: String? {
        set { titleView.title = newValue }
        get { return titleView.title }
    }

    override func layoutSubviews() {
        super.layoutSubviews()
        let maskPath = UIBezierPath(roundedRect: bounds,
                                    byRoundingCorners: [.topLeft, .topRight],
                                    cornerRadii: 8.yp.cgSize)
        maskLayer.path = maskPath.cgPath
        maskLayer.frame = bounds
        layer.mask = maskLayer
    }

    override func makeUI() {
        addSubview(titleView)
        titleView.snp.makeConstraints { make in
            make.top.left.right.equalToSuperview()
            make.height.equalTo(44.wmc_autoVer)
        }
    }
}
